package com.kyivmohyla.kma2.client.view.refbook;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.kyivmohyla.kma2.client.presenter.refbook.TreeGridViewPresenter;
import com.smartgwt.client.widgets.tree.TreeGrid;

public class TreeGridView extends Composite implements TreeGridViewPresenter.Display {
    private static TreeGridViewUiBinder ourUiBinder = GWT.create(TreeGridViewUiBinder.class);
    @UiField
    protected TreeGrid treeGrid;
    @UiField
    protected Button addNode;
    @UiField
    protected Button editNode;
    @UiField
    protected Button deleteNode;
    @UiField
    protected Button back;

    @Override
    public Label getRefsInfo() {
        return refsInfo;
    }

    @UiField
    protected Label refsInfo;


    public TreeGridView() {
        initWidget(ourUiBinder.createAndBindUi(this));
    }

    @Override
    public TreeGrid getTreeGrid() {
        return treeGrid;
    }

    @Override
    public HasClickHandlers getAddNodeButton() {
        return addNode;
    }

    @Override
    public HasClickHandlers getEditButton() {
        return editNode;
    }

    @Override
    public HasClickHandlers getDeleteNodeButton() {
        return deleteNode;
    }

    @Override
    public HasClickHandlers getBackButton() {
        return back;
    }

    @Override
    public Widget asWidget() {
        return this;
    }

    interface TreeGridViewUiBinder extends UiBinder<Widget, TreeGridView> {
    }
}